﻿@using Lari.Configuration
@using Lari.Web.Utility
@model Lari.Services.ViewModel.UserMapModel
<div id="pagetitle">
    <h1>@ScreenName.Users.DeActivate</h1>
</div>
<div class="spacer">
</div>
<div id="pagecontent">
    <div class="tab">
        Employee Details</div>
    <div class="tabContent">
        @Html.Partial("_EmployeeView", Model.EmployeeModel)
    </div>
    
    @if (Model.EmployeeModel.Active)
    {
        using (Html.BeginForm())
        {
            @Html.AntiForgeryToken("deactivate")
            @Html.HiddenFor(m => m.EmpId)		
					
        
					
            <div class="doubleSpacer">
            </div>
            <div>
                <input type="submit" value="De-Activate" id="btnDeactivate" />
            </div>
				
        }

    }
    else
    {
        <div class="spacer">
        </div>  
        @Html.Partial("_DisplyMessaage", MessageCode.User.AllReadyInActive)
		 
    }
    <div class="doubleSpacer">
    </div>
    <div>@Html.ActionLink("Back to Employee Details", ActionConst.Users.ViewEmployee, new { id = Model.EmpId })</div>
    <div class="spacer">
    </div>
</div>
<div id="modal_dialog" style="background: none repeat scroll 0 0 #EEEEEE">Do you want to de-activate this employee?</div>
<script type="text/javascript">

    $(document).ready(function () {
        $("#btnDeactivate").button();
        

        $("#modal_dialog").dialog({
            resizable: false,
            height: 140,
            width: 400,
            modal: true,
            autoOpen: false,
            title: 'De-Activate Confirmation',
            buttons: {
                "Yes": function () {
                    $(this).dialog("close");
                    //window.location = deleteLinkUrl;
                    $("form:last").submit();
                },
                "No": function () {
                    $(this).dialog("close");

                }
            }
        });

        $("#btnDeactivate").live("click", function (e) {
            e.preventDefault();
            $("#modal_dialog").dialog('open');
        });

    });
</script>
